const express = require('express')
const app = express()

 app.use((request, response, next) => {
    console.log('有人请求的服务器1');
    next()
 })

 app.get('/students', (request, response) => {
     const students = [
        {id: '001', name: 'tom', price: 18},
        {id: '002', name: 'jerro', price: 19},
        {id: '003', name: 'tony', price: 20}
     ]
     response.send(students)
 })

 app.listen(5000, (err)=> {
    if (!err) console.log('服务器1启动成功了，请求学生信息地址：http://localhost:5000/students')

 })